<?php
class IndexAction extends CommonAction{
	public function _filter(){

	}

	public function index(){
		$ggao["2"]	= $this->get_ggao(2);
		$this->assign("ggao",$ggao);
		$news	= $this->get_news();
		$this->assign("news",$news);
		//dump($news);
		$this->display();
	}

	protected function get_ggao($position_id){
		$model			= M("Ggao");
		$map["status"]		= 1;
		$map["position_id"]	= $position_id;
		$return			= $model->field("id,url,picture,code,type,position_id,name")->where($map)->select();
		return $return;
	}

	protected function get_news(){
		$model			= M("News as n");
		$map["n.status"]		= 1;
		$return			= $model->field("n.*,nc.name")->join("tx_news_class as nc on n.classid = nc.id")->where($map)->select();
		//echo $model -> getlastsql();
		//dump($return);
		return $return;
	}


}
?>